import requests
import json


def delete_all_topics():
    url = 'http://121.199.62.61/topics'
    r = requests.get(url)
    res = json.loads(r.text)
    for data in res:
        url = 'http://121.199.62.61/topics/' + data['_id']
        r = requests.delete(url)
        if r.status_code == 200:
            print('删除成功：' + data['topicName'])
        else:
            print('删除失败：' + data['topicName'])

def delete_all_banner():
    url = 'http://121.199.62.61/topics'
    r = requests.get(url)
    res = json.loads(r.text)
    for data in res:
        url = 'http://121.199.62.61/topics/' + data['_id']
        r = requests.delete(url)
        if r.status_code == 200:
            print('删除成功：' + data['topicName'])
        else:
            print('删除失败：' + data['topicName'])
